import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false
// 导入路由对应组件
import Find from '@/views/Find' // vue文件中，@表示 src目录的绝对路径
import My from '@/views/My'
import Part from '@/views/Part'
// 导入路由
import VueRouter from 'vue-router'
//注册插件
Vue.use(VueRouter)
//路由规则数组
const routes = [
	//重定向
	{ path: '/', redirect: '/find' },
	{ path: '/find', component: Find },
	{ path: '/my', component: My },
	{ path: '/part', component: Part },
	{ path: '/part/:user', component: Part },
]
//创建路由实例对象
const router = new VueRouter({
	routes,
})


new Vue({
	router,
	render: (h) => h(App),
}).$mount('#app')
